#ifndef __BS_LED_H__
#define __BS_LED_H__
#include <stdint.h>
#include "gd32f4xx.h"


typedef enum {
    LED_IDLE,
    LED_OFF,
    LED_ON,
    LED_SHINE,
    LED_WAIT_SHINE,
}bs_led_state_t;


typedef struct bs_led_dev {
    uint32_t         port;
    uint32_t         pin;
    bs_led_state_t   state;
    int              st_time;
    int              interval;
    int              off_time;
}bs_led_dev_t;

int bs_led_register(bs_led_dev_t *led);
int bs_led_ctl(bs_led_dev_t *led,  bs_led_state_t cmd, int args);
int bs_led_process(void);


#endif
